import request from '../utils/request'

export function getFlowerList(params) {
  return request({
    url: '/api/flowers/page',
    method: 'get',
    params
  })
}

export function getFlowerById(id) {
  return request({
    url: `/api/flowers/${id}`,
    method: 'get'
  })
}

export function createFlower(data) {
  return request({
    url: '/api/flowers',
    method: 'post',
    data
  })
}

export function updateFlower(data) {
  return request({
    url: '/api/flowers',
    method: 'put',
    data
  })
}

export function deleteFlower(id) {
  return request({
    url: `/api/flowers/${id}`,
    method: 'delete'
  })
}

export function updateFlowerStock(id, quantity) {
  return request({
    url: `/api/flowers/${id}/stock`,
    method: 'put',
    params: { quantity }
  })
} 